UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OGBisFM7kLeMO30HJgxq4M6R3NHRC6gzIaHuLoBYhbQ=' 
WHERE 
  key_id = '479180f8deb6b68e30c57ca67a79084d4e584d6cb972d6c4fccf0f4164bf57a4' 
  AND (
    token = 'OGBisFM7kLeMO30HJgxq4M6R3NHRC6gzIaHuLoBYhbQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030