UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SVzxmBEXJIXYJAzrJc550PTXD1jgoqxEGaXH1TBsuhA='
WHERE
key_id = '07a14cdaa94225cf46c40ae647daa95b074ed4c8541ebe2e3c05ff4191137d9b'
AND (
token = 'SVzxmBEXJIXYJAzrJc550PTXD1jgoqxEGaXH1TBsuhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)