UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uDSRAsPt3+4gr9jLkrhdyjE0kpBpLFxFtxK/0bYyI8M='
WHERE
key_id = '7c25341e0c17af6ca2f5e19a073665ebd5aa23e809facab7213b32f281cdca96'
AND (
token = 'uDSRAsPt3+4gr9jLkrhdyjE0kpBpLFxFtxK/0bYyI8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)