UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DDT0Q0KWtGCl6BYLh9QsfkEqi3CZRoeUG/kGv/RCZvQ='
WHERE
key_id = 'b1a3ddf9575b5f99ad102c5ad5ce2e54a0e7f6153476aa7971d825aba2529a10'
AND (
token = 'DDT0Q0KWtGCl6BYLh9QsfkEqi3CZRoeUG/kGv/RCZvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)