UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yGGjy9znNFReSiTrYukrmMn6v21UrZtoJDAqjGi/oJY=' 
WHERE 
  key_id = '0285ba011162ee1555dc773f627e2f47e9708a32c8e7727ee0b62004899e548b' 
  AND (
    token = 'yGGjy9znNFReSiTrYukrmMn6v21UrZtoJDAqjGi/oJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045