UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qnqkNoY+K1Wo7LNguzeFeyCmPDwXwDe1bRiAnAaSiEA='
WHERE
key_id = 'f37f485cd3f6b0cde4ca7470b195f33fa6fb1b9ee03180d569d2198aa78616d5'
AND (
token = 'qnqkNoY+K1Wo7LNguzeFeyCmPDwXwDe1bRiAnAaSiEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)