UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rq/Q6RBarEs1TRr4/YZL8m+/zE27uqyiU8CfzSDqoRs=' 
WHERE 
  key_id = '3d582b0b04991f2821365b9489caf4afcd2a1d4a5eb240fa0e3b6bd27042b01c' 
  AND (
    token = 'Rq/Q6RBarEs1TRr4/YZL8m+/zE27uqyiU8CfzSDqoRs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050