UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pxCkL6HGiNmSgr7/E8WNHre71HgJlfGFYuF4pZKswZU=' 
WHERE 
  key_id = '62849da18b85dccd1a13101f9e499f755a2abb7527f6c8acb138324dc994510a' 
  AND (
    token = 'pxCkL6HGiNmSgr7/E8WNHre71HgJlfGFYuF4pZKswZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033