UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iCwL+iUpO2LPl72PXo1gximIxCkxZyKL2q/BfW7nvzI=' 
WHERE 
  key_id = 'a4f5288a0ea037eab953eb4fe898b4d70f4d4255b147835b69f372f742000860' 
  AND (
    token = 'iCwL+iUpO2LPl72PXo1gximIxCkxZyKL2q/BfW7nvzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029