UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r97SSfysbM1lfsXxdX2XrAfAjLDobsg6dp3WWJzg7kU=' 
WHERE 
  key_id = '0f1bc6520f534f31fca26c0c0b19e24eaebc99db1a93dadefa4584bb28a6d981' 
  AND (
    token = 'r97SSfysbM1lfsXxdX2XrAfAjLDobsg6dp3WWJzg7kU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027