UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vo+4YPMhHZlqBAQHUvOmDlvlwxrv3xWWHcPQ5o3TunY=' 
WHERE 
  key_id = 'cbcbd263bbffa47be02285b0bda70ac116fb22479ea8b8f620bca7d22a20c41e' 
  AND (
    token = 'Vo+4YPMhHZlqBAQHUvOmDlvlwxrv3xWWHcPQ5o3TunY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045