UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l5Qt4Mpj6cUYLMedZZ2Y86Uk5roFn75J5Z7YbCG0Hlo='
WHERE
key_id = '7a615bbe699dd146751b4c721f658fb2cd55e82b5a8be7fb932760b2e9be8a7c'
AND (
token = 'l5Qt4Mpj6cUYLMedZZ2Y86Uk5roFn75J5Z7YbCG0Hlo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)