UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EwiOn+jfMlo4lu8gDSb3zrGBCsCKsIq171YaaKXXAr4='
WHERE
key_id = 'ee65384e0ed78cdb44eb19133203ac3d2669c87d7fc63d9df13b6e04f90b3ee7'
AND (
token = 'EwiOn+jfMlo4lu8gDSb3zrGBCsCKsIq171YaaKXXAr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)