UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ACpf35M8sPE1J3vnajNxSxlGUsSdvQ81nIhcnpDV/s='
WHERE
key_id = 'e42c3923745773901de7c1fa010a43e58f3a7540bf18ac2719ebfa621f5621cc'
AND (
token = '6ACpf35M8sPE1J3vnajNxSxlGUsSdvQ81nIhcnpDV/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)