UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xNdiBBazud/bapqKc5+piiARf7hIFlfuVc5nF/hhEKo=' 
WHERE 
  key_id = 'aa23c65a8a1a91ba158da86376c8918e1c1bb553661a56a2d51bb5c851b095b7' 
  AND (
    token = 'xNdiBBazud/bapqKc5+piiARf7hIFlfuVc5nF/hhEKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014