UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DOngVSK//TVG2M2ePf6659iebSYbZO4WFPKGTp85GvY=' 
WHERE 
  key_id = '68340fc6a382cb34a4daae11f79404c4b840de2810c421f6eea9f4701095fce0' 
  AND (
    token = 'DOngVSK//TVG2M2ePf6659iebSYbZO4WFPKGTp85GvY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037