UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NzRDEexssS72X1D9VmHZnBCLacRg6JExMute0M+gvUk='
WHERE
key_id = 'a1ca02fb6af0fd321b1dd11485b29caeb3bf265e12d1921e62fb9032b1aecb6e'
AND (
token = 'NzRDEexssS72X1D9VmHZnBCLacRg6JExMute0M+gvUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)