UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zzpDQzt0TRGzhkjtKwaT8dTV03pBeDRkFbveDaAcjOo='
WHERE
key_id = 'b314e505e8aaac4a07e45fc63a1e1f0dd9946bd0d016e05290f6ad83ea841574'
AND (
token = 'zzpDQzt0TRGzhkjtKwaT8dTV03pBeDRkFbveDaAcjOo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)