UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RPONHyCKg2rtCidMUQc9qEFXVtnvOiUgfL/Mx1XGSXI='
WHERE
key_id = '6e09a89efef784d1c27e55f94552a0ea8d0a6266287b62a8d31142b4a8158861'
AND (
token = 'RPONHyCKg2rtCidMUQc9qEFXVtnvOiUgfL/Mx1XGSXI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)