UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3tgb0buHZAES/EtwTln8aYRxuNXACR7+pJ+fOFqizfc='
WHERE
key_id = 'bab942beb1dce00112f94187cea96626330dacd6ae39aa0a03f158bdf9c57f8f'
AND (
token = '3tgb0buHZAES/EtwTln8aYRxuNXACR7+pJ+fOFqizfc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)