UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'skY+nUpefjOQwiNjllUTXAjvoY5zaTw4jOyExeWsiJc='
WHERE
key_id = '05d89661d85a93ade7f2b70020f74a22682ca637d69a00ff9456e152dd40f586'
AND (
token = 'skY+nUpefjOQwiNjllUTXAjvoY5zaTw4jOyExeWsiJc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)