UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JvJrEKNRbg6rDZMbZCeZGzo5Vg1z5AMZCGYcpfcLkNg='
WHERE
key_id = '15bb346a5f0fe8dd0d3eccf7cad927e5fb165b09aa10f04b49abb0abefa9e9ae'
AND (
token = 'JvJrEKNRbg6rDZMbZCeZGzo5Vg1z5AMZCGYcpfcLkNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)