UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4K6xREGQfZXAdLKhCUZWkvvKq4Bnv7QLACLX2zEIwBg='
WHERE
key_id = '3fb6b85262e9f787d85cac4e6e1c06d3124228f80ab73965847a349e0c060862'
AND (
token = '4K6xREGQfZXAdLKhCUZWkvvKq4Bnv7QLACLX2zEIwBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)