UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P/2oDYLMk11PSVB95i83RtJtiio1lnLV4vcH10GoT5I=' 
WHERE 
  key_id = '07acc940963777e7f4cd86161a40805db1d46912c910a1ec6b57de62d8a63c18' 
  AND (
    token = 'P/2oDYLMk11PSVB95i83RtJtiio1lnLV4vcH10GoT5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00143