UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jockIIUEdcf9B5ANktqz1jNd2r/68CcEVFSVrg8mHJg=' 
WHERE 
  key_id = '1631e479c946d6e08756dfd5ac99a55a1589045048af8ecaeabdfc7f74260344' 
  AND (
    token = 'jockIIUEdcf9B5ANktqz1jNd2r/68CcEVFSVrg8mHJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041