UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AIE8Ai61s+eF5KkvYO05v2frPY3WmLf09j3VZT9nT9k='
WHERE
key_id = '747fcd1b05483f407752e8e4150293084dd8df75fdce2cc3f2405b3a4014f0ca'
AND (
token = 'AIE8Ai61s+eF5KkvYO05v2frPY3WmLf09j3VZT9nT9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)