UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ksPHG13jhjzsqjNF8feRBf29PU/SMKDSJVAiow/nkpE=' 
WHERE 
  key_id = 'a1b5e9fca16ac0e5fc5b812061af85df4055af772c7a0eb0d06da881deffd4be' 
  AND (
    token = 'ksPHG13jhjzsqjNF8feRBf29PU/SMKDSJVAiow/nkpE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017